/**
 * Created by Administrator on 2017-07-25.
 */
var modelDataExploreTemplete = require('html!./model_data_explore.html');
require('./model.less');
module.exports = {
  template: modelDataExploreTemplete,
  data:function(){
    return{
      modelId:'',
      modelFieldData:[],
      type:'',
      userId:localStorage.getItem('userId')
    }
  },
  created:function(){
    this.modelId = this.$route.query.modelId;
    this.type = this.$route.query.type;
    this.initDataList();
  },
  beforeMount:function(){

  },
  updated:function(){
    //this.initCommonModel();
  },
  methods:{
    initDataList:function(){
      var me = this;
      this.$http.get('/eyeModelController/getUploadDataList.do?modelId='+me.modelId)
        .then(function(res){
          if(res.data.status === 'OK'){
            this.modelFieldData = res.data.result.list;
          }else{
            layer.msg("没有相关数据");
          }
        }.bind(this));
    },
    submitPre:function () {
      var me = this;
      if(me.type=="add"){
        me.$router.push({path: '/product/modelImportData', query: {modelId: me.modelId + ""}});
      }else {
        me.$router.push({path: '/product/modelImportDataEdit', query: {modelId: me.modelId + "",oldModelId:me.modelId+""}});
      }
    },
    submit:function () {
      var me = this;
      me.$router.push({ path: '/product/inputSet', query: { modelId: me.modelId+"",type:me.type+"" }});
    }
  }
}
